package com.itheima.service.impl;

import com.itheima.dao.AccountDao;
import com.itheima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountDao accountDao;
    @Override
    public void transfer(String outName, String inName, int money) throws SQLException {
        System.out.println("转账方法执行了");
        accountDao.out(outName , money);
        //模拟宕机 死机 蓝屏 断电
        //int i = 1/0;

        accountDao.in(inName , money);
    }
}
